# -*- coding: utf8 -*-

import unittest

from game_history import *


class GameHistoryTest(unittest.TestCase):
    def test_equal(self):
        word1 = Word(text="word_1", owner=1)
        word2 = Word(text="word_1", owner=2)
        self.assertNotEqual(word1, word2)
        word1 = Word(text="word_1", owner=1)
        word2 = Word(text="word_2", owner=1)
        self.assertNotEqual(word1, word2)
        word1 = Word(text="word_1", owner=1)
        word2 = Word(text="word_2", owner=2)
        self.assertNotEqual(word1, word2)
        word1 = Word(text="word_1", owner=1)
        word2 = Word(text="word_1", owner=1)
        self.assertEqual(word1, word2)

    def test_hash(self):
        word1 = Word(text="word_1", owner=1)
        word2 = Word(text="word_1", owner=2)
        self.assertNotEqual(hash(word1), hash(word2))
        word1 = Word(text="word_1", owner=1)
        word2 = Word(text="word_2", owner=1)
        self.assertNotEqual(hash(word1), hash(word2))
        word1 = Word(text="word_1", owner=1)
        word2 = Word(text="word_2", owner=2)
        self.assertNotEqual(hash(word1), hash(word2))
        word1 = Word(text="word_1", owner=1)
        word2 = Word(text="word_1", owner=1)
        self.assertEqual(hash(word1), hash(word2))


if __name__ == "__main__":
    unittest.main()
